Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setup script for Python 3.7 #9605

Merged
merged 3 commits into from
Jun 11, 2019
Merged

Update setup script for Python 3.7 #9605

merged 3 commits into from
Jun 11, 2019

Conversation

LeonarddeR
Copy link
Collaborator

Link to issue number:

Fixes #8375
Closes #9604

Summary of the issue:

For the Python 2 distribution of NVDA< we're using py2exe 0.6, which is compatible with NVDA. For the Python 3 migration/transition, we decided to go with the py2exe fork by @albertosottile.

Description of how this pull request fixes the issue:

This pr converts the setup script to be compatible with py2exe>0.9.3.1. In short, the following had to be changed:

  • Several imports and super calls in our py2exe command subclass
  • The monkeypatch that excludes certain system dlls is still there, though modified for the new situation
  • The manifest implementation has been rebuild. I consider the new implementation to be more elegant, as it offers us full flexibility over the manifest. The uiAccess flag is added to the manifest at runtime of the builder.
  • As py2exe no longer seems to strip the base path from tracebacks, the logHandler now does this in all cases.
  • the product name is explicitly added to every target
  • I decided to remove the handy tech com server from the manifest, see Again remove Handy Tech com server from NVDA distributions #9604. If it is decided to revert this change, it will require us to do more work in order for it only to be integrated in the executables that need it (i.e. I assume not in the slave and eoa proxy).

Testing performed:

The command to run py2exe on my system looked as follows:
c:\python37\python.exe setup.py build --build-base ..\build py2exe --dist-dir ..\dist

  • Tested locally using @josephsl's py3000 branch, which some small fixes to nvda_slave and appModules.soffice, which are not included into this pr. I also had to import sourceEnv in the setup script. This is a draft for a reason, see below
  • Made sure that the manifests were added correctly, and that uiAccess is set to True in the manifest of nvda_uiAccess

Known issues with pull request:

This relies on several things to be done first:

  • Code syntax compatibility with Python 3
  • Inclusion of pySerial 3.4: Update to pyserial 3.4 #8815
  • Update of scons to use python 3.7
  • Update of several external dependencies, such as the wxPython binary distribution and miscdeps

Change log entry:

t.b.d.

@LeonarddeR
Copy link
Collaborator Author

Note that the appveyor build failure is expected.

@albertosottile
Copy link

A clarification on py2exe versioning and CI that might be useful for the future. The current version of the forked py2exe is 0.9.3.0. I plan to release the next version (0.9.3.1) only once all the fixes needed to pack NVDA are finished, so, in principle, NVDA will be compatible with py2exe>=0.9.3.1.

Nevertheless, the wheels are compiled and published in real time after each commit, and you will find them in the py2exe Bintray. These wheels are always updated, hence the 0.9.3.1 version number, and right now they include your PR about .ico files. Feel free to download and install them to test directly the effects of your changes on NVDA.

When it is ready, the final release of 0.3.9.1 will be frozen and published on GitHub (and, in the future, on PyPI). As you can imagine, commits that will come after the release will be compiled and published on Bintray under the next version name (presumably 0.9.3.2).

Copy link
Member

@michaelDCurran michaelDCurran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good.
You may want to consider changing the template sintax for the manifest to use Python format syntax I.e.

{UIA}

rather than

%(UIA)s

and obviously then change

manifest_template%dict(UIAccess=target['UIAccess'])

to

manifest_template.format(UIAccess=target['UIAccess'])

@LeonarddeR
Copy link
Collaborator Author

LeonarddeR commented May 29, 2019 via email

@michaelDCurran
Copy link
Member

michaelDCurran commented May 29, 2019 via email

@LeonarddeR
Copy link
Collaborator Author

LeonarddeR commented May 29, 2019 via email

@michaelDCurran
Copy link
Member

michaelDCurran commented May 29, 2019 via email

@LeonarddeR
Copy link
Collaborator Author

I squashed this all in one commit for ease of testing

@michaelDCurran
Copy link
Member

This is still marked as draft. As dependencies are now updated in threshold_py3_staging, is this ready to be reviewed?

@LeonarddeR
Copy link
Collaborator Author

Yes, thanks for remindingb.

@LeonarddeR LeonarddeR marked this pull request as ready for review June 10, 2019 09:30
@LeonarddeR LeonarddeR changed the base branch from threshold to threshold_py3_staging June 10, 2019 10:26
@michaelDCurran michaelDCurran merged commit f1f823e into nvaccess:threshold_py3_staging Jun 11, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jun 11, 2019
@LeonarddeR LeonarddeR deleted the py2exe branch June 20, 2019 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants